package com.onlineClass.edu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.onlineClass.edu.entity.EduUser;
import com.onlineClass.edu.mapper.EduUserMapper;
import com.onlineClass.edu.service.IEduUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author denghui
 * @since 2024-05-02
 */
@Service
public class EduUserServiceImpl extends ServiceImpl<EduUserMapper, EduUser> implements IEduUserService {
@Autowired
private EduUserMapper eduUserMapper;
    @Override
    public EduUser findByUserNameEduUser(String userName) {
        //lambda条件
        LambdaQueryWrapper<EduUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(EduUser::getUserName,userName);
        return eduUserMapper.selectOne(queryWrapper);
    }

    @Override
    public EduUser fingByUserID(int userId) {
        return eduUserMapper.selectById(userId);
    }
}
